\hypertarget{class_rect}{
\section{Rect Class Reference}
\label{class_rect}\index{Rect@{Rect}}
}


: Classe dérivé de \hyperlink{class_displayable}{Displayable} représentant un rectangle dans la scène OpenGL  




{\ttfamily \#include $<$rect.h$>$}

Inheritance diagram for Rect:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{class_rect}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_rect_a911e531b86de33734dd7de3456722115}{Rect} ()
\begin{DoxyCompactList}\small\item\em Construit un carré de taille 1 sur la matrice identité \item\end{DoxyCompactList}\item 
\hyperlink{class_rect_a6ca81fe7aad32dc6f12a7942b937e751}{Rect} (float size)
\begin{DoxyCompactList}\small\item\em Construit un carré en 0. \item\end{DoxyCompactList}\item 
\hyperlink{class_rect_aa07d0e2bcfa67e3d245aea54b03094ba}{Rect} (float size, \hyperlink{class_vectorf}{Vectorf} position)
\item 
\hyperlink{class_rect_a82cdf5b0964b77a81ed370173370de0d}{Rect} (float size, \hyperlink{class_vectorf}{Vectorf} aposition, \hyperlink{class_vectorf}{Vectorf} arotation)
\item 
\hyperlink{class_rect_ab9257ac6270f701a72e094777dcad8fb}{Rect} (float awidth, float aheight)
\begin{DoxyCompactList}\small\item\em Construit un Rectangle en 0. \item\end{DoxyCompactList}\item 
\hyperlink{class_rect_a8586400f6c6d61266b57003c0fe6a409}{Rect} (float aWidth, float aHeight, \hyperlink{class_vectorf}{Vectorf} aTranslation)
\item 
\hyperlink{class_rect_af5c075b863024c3e39add95e07d10f39}{$\sim$Rect} ()
\item 
virtual void \hyperlink{class_rect_afe7479ce40216a8f570add95c478edc5}{Display} ()
\begin{DoxyCompactList}\small\item\em Affiche le Rectangle dans une scene OpenGL. \item\end{DoxyCompactList}\item 
void \hyperlink{class_rect_a795fbc425d21d8926fc4128dd9be9236}{InitBuffers} ()
\begin{DoxyCompactList}\small\item\em Initialise les VBO (vertex buffer objects) utilisés pour représenter le rectangle. \item\end{DoxyCompactList}\item 
void \hyperlink{class_rect_a0e715e690a1894db184a31782bac8b9f}{RenderBuffers} ()
\begin{DoxyCompactList}\small\item\em Méthode utilisé pour afficher le contenu des buffers. \item\end{DoxyCompactList}\item 
void \hyperlink{class_rect_ad5f35f1d3aace59e616faed811a196e7}{SetColor} (float x, float y, float z)
\item 
void \hyperlink{class_rect_a95367de281352ffa475fb7b1d5926aaa}{FillColorBuffer} ()
\item 
virtual void \hyperlink{class_rect_abdf134813888e6b11e73df275ed40892}{Picking} ()
\item 
virtual void \hyperlink{class_rect_a16876637997781cb8863a798c4225319}{SetPicking} (unsigned char x, unsigned char y, unsigned char z)
\item 
int \hyperlink{class_rect_a63dea2c66be20790845efe09dade4ace}{RayIntersection} (\hyperlink{class_vectorf}{Vectorf} $\ast$ray)
\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
float \hyperlink{class_rect_a800053c390ccb818add47e627e535a5e}{width}
\item 
float \hyperlink{class_rect_a31428cce67b56b6daf168131c7dbe1e8}{height}
\item 
\hyperlink{class_vectorf}{Vectorf} \hyperlink{class_rect_ae32813fabf99e25bbe1a6bf8ea06774c}{normal}
\item 
\hyperlink{class_vectorf}{Vectorf} \hyperlink{class_rect_acfb62808faf69f0a81e8307484b83ffc}{color}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
: Classe dérivé de \hyperlink{class_displayable}{Displayable} représentant un rectangle dans la scène OpenGL 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_rect_a911e531b86de33734dd7de3456722115}{
\index{Rect@{Rect}!Rect@{Rect}}
\index{Rect@{Rect}!Rect@{Rect}}
\subsubsection[{Rect}]{\setlength{\rightskip}{0pt plus 5cm}Rect::Rect (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_rect_a911e531b86de33734dd7de3456722115}


Construit un carré de taille 1 sur la matrice identité 

\hypertarget{class_rect_a6ca81fe7aad32dc6f12a7942b937e751}{
\index{Rect@{Rect}!Rect@{Rect}}
\index{Rect@{Rect}!Rect@{Rect}}
\subsubsection[{Rect}]{\setlength{\rightskip}{0pt plus 5cm}Rect::Rect (
\begin{DoxyParamCaption}
\item[{float}]{size}
\end{DoxyParamCaption}
)}}
\label{class_rect_a6ca81fe7aad32dc6f12a7942b937e751}


Construit un carré en 0. 


\begin{DoxyParams}{Parameters}
{\em size} & : coté du carré \\
\hline
\end{DoxyParams}
\hypertarget{class_rect_aa07d0e2bcfa67e3d245aea54b03094ba}{
\index{Rect@{Rect}!Rect@{Rect}}
\index{Rect@{Rect}!Rect@{Rect}}
\subsubsection[{Rect}]{\setlength{\rightskip}{0pt plus 5cm}Rect::Rect (
\begin{DoxyParamCaption}
\item[{float}]{size, }
\item[{{\bf Vectorf}}]{position}
\end{DoxyParamCaption}
)}}
\label{class_rect_aa07d0e2bcfa67e3d245aea54b03094ba}
\hypertarget{class_rect_a82cdf5b0964b77a81ed370173370de0d}{
\index{Rect@{Rect}!Rect@{Rect}}
\index{Rect@{Rect}!Rect@{Rect}}
\subsubsection[{Rect}]{\setlength{\rightskip}{0pt plus 5cm}Rect::Rect (
\begin{DoxyParamCaption}
\item[{float}]{size, }
\item[{{\bf Vectorf}}]{aposition, }
\item[{{\bf Vectorf}}]{arotation}
\end{DoxyParamCaption}
)}}
\label{class_rect_a82cdf5b0964b77a81ed370173370de0d}
\hypertarget{class_rect_ab9257ac6270f701a72e094777dcad8fb}{
\index{Rect@{Rect}!Rect@{Rect}}
\index{Rect@{Rect}!Rect@{Rect}}
\subsubsection[{Rect}]{\setlength{\rightskip}{0pt plus 5cm}Rect::Rect (
\begin{DoxyParamCaption}
\item[{float}]{aWidth, }
\item[{float}]{aHeight}
\end{DoxyParamCaption}
)}}
\label{class_rect_ab9257ac6270f701a72e094777dcad8fb}


Construit un Rectangle en 0. 


\begin{DoxyParams}{Parameters}
{\em aWidth} & : longueur du carré \\
\hline
{\em aHeight} & : largeur du carré \\
\hline
\end{DoxyParams}
\hypertarget{class_rect_a8586400f6c6d61266b57003c0fe6a409}{
\index{Rect@{Rect}!Rect@{Rect}}
\index{Rect@{Rect}!Rect@{Rect}}
\subsubsection[{Rect}]{\setlength{\rightskip}{0pt plus 5cm}Rect::Rect (
\begin{DoxyParamCaption}
\item[{float}]{aWidth, }
\item[{float}]{aHeight, }
\item[{{\bf Vectorf}}]{aTranslation}
\end{DoxyParamCaption}
)}}
\label{class_rect_a8586400f6c6d61266b57003c0fe6a409}
\hypertarget{class_rect_af5c075b863024c3e39add95e07d10f39}{
\index{Rect@{Rect}!$\sim$Rect@{$\sim$Rect}}
\index{$\sim$Rect@{$\sim$Rect}!Rect@{Rect}}
\subsubsection[{$\sim$Rect}]{\setlength{\rightskip}{0pt plus 5cm}Rect::$\sim$Rect (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_rect_af5c075b863024c3e39add95e07d10f39}


\subsection{Member Function Documentation}
\hypertarget{class_rect_afe7479ce40216a8f570add95c478edc5}{
\index{Rect@{Rect}!Display@{Display}}
\index{Display@{Display}!Rect@{Rect}}
\subsubsection[{Display}]{\setlength{\rightskip}{0pt plus 5cm}Rect::Display (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{class_rect_afe7479ce40216a8f570add95c478edc5}


Affiche le Rectangle dans une scene OpenGL. 



Implements \hyperlink{class_displayable_add567ad9bd6430368abca09a910863b5}{Displayable}.



Reimplemented in \hyperlink{class_sprite_aea0b93168a3264219b8f270cc1bcf157}{Sprite}, and \hyperlink{class_textured_rect_ad70565dc4927a8f6f7de8b006d51485a}{TexturedRect}.

\hypertarget{class_rect_a95367de281352ffa475fb7b1d5926aaa}{
\index{Rect@{Rect}!FillColorBuffer@{FillColorBuffer}}
\index{FillColorBuffer@{FillColorBuffer}!Rect@{Rect}}
\subsubsection[{FillColorBuffer}]{\setlength{\rightskip}{0pt plus 5cm}void Rect::FillColorBuffer (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_rect_a95367de281352ffa475fb7b1d5926aaa}
\hypertarget{class_rect_a795fbc425d21d8926fc4128dd9be9236}{
\index{Rect@{Rect}!InitBuffers@{InitBuffers}}
\index{InitBuffers@{InitBuffers}!Rect@{Rect}}
\subsubsection[{InitBuffers}]{\setlength{\rightskip}{0pt plus 5cm}Rect::InitBuffers (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_rect_a795fbc425d21d8926fc4128dd9be9236}


Initialise les VBO (vertex buffer objects) utilisés pour représenter le rectangle. 



Dans un premier temps, je fais appel à la méthode glGenBuffers qui permet de créer un espace mémoire dans la carte graphique qui sera utilisé pour stocker des informations de différents types (coordonnées du sommet, couleurs, normales etc) Chaque espace mémoire ainsi alloué sera identifié par l'entier retourné par cette fonction

On utilise glBindBuffer pour définir l'espace mémoire courant. Toutes les opérations en rapport avec les buffers modifieront l'espace mémoire courant défini par cette méthode

Je définis les coordonnées des sommets de mon carré

J'utilise la méthode glBufferData afin de remplir mon espace mémoire premier argument : le type de buffer, deuxieme, la taille du buffer, 3 eme : les données, 4 eme ; truc à la con, voir doc

Même opération pour stocker les informations concernant la couleur des sommets

Initialisation du buffer gérant les indices

Indice des éléments (couleurs, coordonnées spatiales, à afficher)

\hypertarget{class_rect_abdf134813888e6b11e73df275ed40892}{
\index{Rect@{Rect}!Picking@{Picking}}
\index{Picking@{Picking}!Rect@{Rect}}
\subsubsection[{Picking}]{\setlength{\rightskip}{0pt plus 5cm}void Rect::Picking (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{class_rect_abdf134813888e6b11e73df275ed40892}


Implements \hyperlink{class_displayable_aee2332fcbbb86e4804f25f64f0df1df2}{Displayable}.

\hypertarget{class_rect_a63dea2c66be20790845efe09dade4ace}{
\index{Rect@{Rect}!RayIntersection@{RayIntersection}}
\index{RayIntersection@{RayIntersection}!Rect@{Rect}}
\subsubsection[{RayIntersection}]{\setlength{\rightskip}{0pt plus 5cm}int Rect::RayIntersection (
\begin{DoxyParamCaption}
\item[{{\bf Vectorf} $\ast$}]{ray}
\end{DoxyParamCaption}
)}}
\label{class_rect_a63dea2c66be20790845efe09dade4ace}
\hypertarget{class_rect_a0e715e690a1894db184a31782bac8b9f}{
\index{Rect@{Rect}!RenderBuffers@{RenderBuffers}}
\index{RenderBuffers@{RenderBuffers}!Rect@{Rect}}
\subsubsection[{RenderBuffers}]{\setlength{\rightskip}{0pt plus 5cm}Rect::RenderBuffers (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_rect_a0e715e690a1894db184a31782bac8b9f}


Méthode utilisé pour afficher le contenu des buffers. 

\hypertarget{class_rect_ad5f35f1d3aace59e616faed811a196e7}{
\index{Rect@{Rect}!SetColor@{SetColor}}
\index{SetColor@{SetColor}!Rect@{Rect}}
\subsubsection[{SetColor}]{\setlength{\rightskip}{0pt plus 5cm}void Rect::SetColor (
\begin{DoxyParamCaption}
\item[{float}]{x, }
\item[{float}]{y, }
\item[{float}]{z}
\end{DoxyParamCaption}
)}}
\label{class_rect_ad5f35f1d3aace59e616faed811a196e7}
\hypertarget{class_rect_a16876637997781cb8863a798c4225319}{
\index{Rect@{Rect}!SetPicking@{SetPicking}}
\index{SetPicking@{SetPicking}!Rect@{Rect}}
\subsubsection[{SetPicking}]{\setlength{\rightskip}{0pt plus 5cm}void Rect::SetPicking (
\begin{DoxyParamCaption}
\item[{unsigned char}]{x, }
\item[{unsigned char}]{y, }
\item[{unsigned char}]{z}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{class_rect_a16876637997781cb8863a798c4225319}


Implements \hyperlink{class_displayable_a146f85eee63f867586fd26d96a208a96}{Displayable}.



\subsection{Member Data Documentation}
\hypertarget{class_rect_acfb62808faf69f0a81e8307484b83ffc}{
\index{Rect@{Rect}!color@{color}}
\index{color@{color}!Rect@{Rect}}
\subsubsection[{color}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Vectorf} {\bf Rect::color}}}
\label{class_rect_acfb62808faf69f0a81e8307484b83ffc}
Composantes RGB ou RGBA de la couleur du rectangle en float (entre 0.0 et 1.0) \hypertarget{class_rect_a31428cce67b56b6daf168131c7dbe1e8}{
\index{Rect@{Rect}!height@{height}}
\index{height@{height}!Rect@{Rect}}
\subsubsection[{height}]{\setlength{\rightskip}{0pt plus 5cm}float {\bf Rect::height}}}
\label{class_rect_a31428cce67b56b6daf168131c7dbe1e8}
Largeur du rectangle \hypertarget{class_rect_ae32813fabf99e25bbe1a6bf8ea06774c}{
\index{Rect@{Rect}!normal@{normal}}
\index{normal@{normal}!Rect@{Rect}}
\subsubsection[{normal}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Vectorf} {\bf Rect::normal}}}
\label{class_rect_ae32813fabf99e25bbe1a6bf8ea06774c}
Direction du vecteur normal utilisé pour déterminer le plan du rectangle \hypertarget{class_rect_a800053c390ccb818add47e627e535a5e}{
\index{Rect@{Rect}!width@{width}}
\index{width@{width}!Rect@{Rect}}
\subsubsection[{width}]{\setlength{\rightskip}{0pt plus 5cm}float {\bf Rect::width}}}
\label{class_rect_a800053c390ccb818add47e627e535a5e}
Longueur du rectangle 

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
sources/displayable/\hyperlink{rect_8h}{rect.h}\item 
sources/displayable/\hyperlink{rect_8cpp}{rect.cpp}\end{DoxyCompactItemize}
